import 'dart:async';

class StateSubject {
  static final StateSubject _instance = StateSubject._();

  factory StateSubject() => StateSubject._instance;

  late StreamController<String> streamController;

  StateSubject._() {
    streamController = StreamController.broadcast(onListen: (){
    });
  }

  void update(String num) {
    streamController.sink.add(num);
  }
}
